Page 1 of 1
html module - Create a responsive table
Posted: Tue Feb 02, 2016 7:32 pm
by ESS1
Hi, I am using version 2.0.1.1 and the html content module to insert a table, however it is not responsive.
Can anyone help me create a 2 row 2 column table that I can insert images into?
Many thanks
Re: html module - Create a responsive table
Posted: Tue Feb 02, 2016 10:07 pm
by ocart777
you can try this one, but make sure to add this in code editor mode
Code: Select all
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<td class="text-left col-sm-6">COLUMN 1</td>
<td class="text-left col-sm-6">COLUMN 2</td>
</tr>
</thead>
<tbody>
<tr>
<td class="text-left">ROW 1</td>
<td class="text-left">ROW 2</td>
</tr>
</tbody>
</table>
</div>
Re: html module - Create a responsive table
Posted: Wed Feb 03, 2016 3:35 am
by ESS1
No it adds it to the bottom of the page and is not responsive

Re: html module - Create a responsive table
Posted: Wed Feb 03, 2016 11:29 am
by ocart777
its seem to be working fine with me on default template and on any position with responsive, just make sure you did change the sort order of the layout on home(design/layout/home) and one more thing is the content bottom of your template seem like it is placed after the footer, just in case please confirm that your home.tpl code looks more likely like this.
Code: Select all
<?php echo $header; ?>
<div class="container">
<div class="row"><?php echo $column_left; ?>
<?php if ($column_left && $column_right) { ?>
<?php $class = 'col-sm-6'; ?>
<?php } elseif ($column_left || $column_right) { ?>
<?php $class = 'col-sm-9'; ?>
<?php } else { ?>
<?php $class = 'col-sm-12'; ?>
<?php } ?>
<div id="content" class="<?php echo $class; ?>"><?php echo $content_top; ?><?php echo $content_bottom; ?></div>
<?php echo $column_right; ?></div>
</div>
<?php echo $footer; ?>
and one more thing is, please try to put an .img-responsive class on your image
Edit*
here some example of mine
htmlmodule1.jpg (124.68 KiB) Viewed 2848 times
htmlmodule2.jpg (119.93 KiB) Viewed 2848 times
Re: html module - Create a responsive table
Posted: Wed Feb 03, 2016 7:22 pm
by ESS1
Thanks.
I have it working with your code now and is reponsive!
BUT as I add images instead of your text it breaks .... See screen shot.
Thanks so much for your help so far

Re: html module - Create a responsive table
Posted: Wed Feb 03, 2016 11:48 pm
by ocart777
ESS1 wrote:BUT as I add images instead of your text it breaks .... See screen shot.
i don't really get what you mean, what are you trying to archive actually? may see the html code you've done so far?