Solved

Change # of columns and with in a table

Posted on 2014-09-06
4
108 Views
Last Modified: 2014-09-07
Is there a way to have a table that has 10 columns and the last row only has 4?
I'm trying to center the 4 buttons at the end of the table.
For eample:
|-------------------------------------------------------------------------------------------------------------|
|col1         |col2       |col3     |col4     |col5    |col6    |col7    |col8    |col9    |col10   |
|                                                                                                                                         | 
|               |button1|                |button2|             |button3|             |button4|           |
|-------------------------------------------------------------------------------------------------------------|

Open in new window


It would be easy if all the columns were the same size, but they are not.
0
Comment
Question by:breeze351
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40307841
Use in each cell of the last row
colspan=""

Though 4 will not go into 10 so you would end with something like 2,2,3,3
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 40307859
Use CSS to style div elements.  Tables made sense in 1996 before we had good browser support for CSS.
http://www.w3schools.com/css/
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 40307954
Ray may or may not be right.  If the table is presenting tabular data then a table is the correct structure.  However if you anre managing layout with a table then you are just creating maintenance problems for yourself. If it is a form, then rather than using styled divs you should use styled fieldsets for layout management to be semantically correct.

In any case, there is no reason to have the buttons as the final row of the table.  Put them in a container element outside the table and then you can position them any way you want using CSS.

Cd&
0
 

Author Closing Comment

by:breeze351
ID: 40308801
I awoke in the middle of the night.  "GOT IT!!!"  Just set a different <DIV> in the CSS.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML5 frame 5 26
URGENT - Wordpress site missing  theme 9 41
Changing Two Areas of a Page 5 17
Make options hidden and show just option that is on 1 19
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question