Solved

Change # of columns and with in a table

Posted on 2014-09-06
4
106 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
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
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
Comment Utility
I awoke in the middle of the night.  "GOT IT!!!"  Just set a different <DIV> in the CSS.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now