I have three tables that are all contained in a div. I am trying to get them to all show inline in the div, but they each show on their own line. I set them all to display: inline at the table level, but this didn't do the trick. Any ideas of how to get multiple tables to show on the same line?
<div id="container">
<table id="previous-arrow" class="scroll">
<tr>
<td><a href="#" id="nav-prev"><span>Previous</span></a></td>
</tr>
</table>
<table id="tour-carousel">
<tr id="carousel-row">
<td>data here</td>
</tr>
</table>
<table id="next-arrow" class="scroll">
<tr>
<td><a href="#" id="nav-next"><span>Next</span></a></td>
</tr>
</table>
</div>
You can merge (combine) rows from one table into another simply by pasting the data in the first empty cells below the target table. The table will increase in size to include the new rows.
Creating Tables in HTMLYou can create a table using the <table> element. Inside the <table> element, you can use the <tr> elements to create rows, and to create columns inside a row you can use the <td> elements. You can also define a cell as a header for a group of table cells using the <th> element.
Tables can be divided into three portions − a header, a body, and a foot. The head and foot are rather similar to headers and footers in a word-processed document that remain the same for every page, while the body is the main content holder of the table. <thead> − to create a separate table header.
You want to make them display inline, but still as tables (otherwise their content will create anonymous table blocks which cause wrapping).
display: inline-table;
You can float them:
HTML
<div class="container">
<table><tr><td>Table 1</td></tr></table>
<table><tr><td>Table 2</td></tr></table>
<table><tr><td>Table 3</td></tr></table>
</div>
CSS
table {
float:left;
width:33%;
}
Fiddle: http://jsfiddle.net/kboucher/6HuyW/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With