473,425 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

CSS Layout question - how to duplicate a table layout with CSS

I'm trying to reproduce the following table layout using CSS only and am
having some trouble with it. I'd like them to look identical but I'm having
trouble sizing the labels properly as it doesnt seem to be working
correctly:

Here's the table:

<table class="Table1" cellSpacing="0" cellPadding="0"
borderColorLight="white" border="1">
<tr class="HeaderTr">
<td align="center">Static Reports</td>
<td align="center">Real Time Reports</td>
<td align="center">Daily Reports</td>
<td align="center">Month End Reports</td>
</tr>
<tr>
<td align="center"><asp:label id="lStaticUpdateTime" RUNAT="server"
WIDTH="173px"></asp:label></td>
<td align="center"><asp:label id="lCurrentReportsTime"
RUNAT="server" WIDTH="173px"></asp:label></td>
<td align="center"><asp:dropdownlist id="dDailyDate" RUNAT="server"
WIDTH="173px"></asp:dropdownlist></td>
<td align="center"><asp:dropdownlist id="dEomDate" RUNAT="server"
WIDTH="173px"></asp:dropdownlist></td>
</tr>
</table>

Here's the style sheet entry for the table.
..Table1
{
background-color: #6699cc;
font-family: Verdana, Arial;
font-size: 11px;
color: white;
border: 0px;
text-align: left;
font-weight: bold;
}

Nov 19 '05 #1
4 1478
Ah, part of the problem is Visual Studio doesnt display it correctly in
design mode when using CSS. You have to use View in Browser to get what it
really looks like. Although I'm not sure how to remove the spacing between
labels, it looks closer now.
Is there any way to specify a percentage size? I tried Width=25% hoping
that would make the label 25% the width of the container but that didnt
work.
Here's my first attempt using solely CSS. It looks bad in VS design mode
but ok in a browser:

<asp:Panel id="Panel1" style="Z-INDEX: 101; LEFT: 40px; POSITION:
absolute; TOP: 40px" runat="server"
CssClass="ReportTypes">
<asp:Label id="lblStatic" runat="server"
CSSclass="QuarterLabel">Static</asp:Label>
<asp:Label id="lblCurrent" runat="server" CSSclass="QuarterLabel">Real
Time</asp:Label>
<asp:Label id="lblDaily" runat="server"
CSSclass="QuarterLabel">Daily</asp:Label>
<asp:Label id="lblMonthEnd" runat="server" CssClass="QuarterLabel">Month
End</asp:Label>
<asp:Label id="txtStatic" CssClass="QuarterLabel"
Runat="server">12/4/2004</asp:Label>
<asp:Label id="txtCurrent" CssClass="QuarterLabel"
Runat="server">12/5/2004</asp:Label>
<asp:DropDownList id="ddlDaily" CssClass="QuarterLabel"
Runat="server"></asp:DropDownList>
<asp:DropDownList id="ddlMonthEnd" CssClass="QuarterLabel"
Runat="server"></asp:DropDownList>
</asp:Panel>

..QuarterLabel
{
border: solid 1 black;
position: relative;
text-align: center;
width: 173px;
}

"Eric" <er**@nospam.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl...
I'm trying to reproduce the following table layout using CSS only and am
having some trouble with it. I'd like them to look identical but I'm having trouble sizing the labels properly as it doesnt seem to be working
correctly:

Here's the table:

<table class="Table1" cellSpacing="0" cellPadding="0"
borderColorLight="white" border="1">
<tr class="HeaderTr">
<td align="center">Static Reports</td>
<td align="center">Real Time Reports</td>
<td align="center">Daily Reports</td>
<td align="center">Month End Reports</td>
</tr>
<tr>
<td align="center"><asp:label id="lStaticUpdateTime" RUNAT="server" WIDTH="173px"></asp:label></td>
<td align="center"><asp:label id="lCurrentReportsTime"
RUNAT="server" WIDTH="173px"></asp:label></td>
<td align="center"><asp:dropdownlist id="dDailyDate" RUNAT="server" WIDTH="173px"></asp:dropdownlist></td>
<td align="center"><asp:dropdownlist id="dEomDate" RUNAT="server"
WIDTH="173px"></asp:dropdownlist></td>
</tr>
</table>

Here's the style sheet entry for the table.
.Table1
{
background-color: #6699cc;
font-family: Verdana, Arial;
font-size: 11px;
color: white;
border: 0px;
text-align: left;
font-weight: bold;
}

Nov 19 '05 #2
there is no css equalivent value for cellpadding and cellspacing, as this is
a table only attribute.

-- bruce (sqlwork.com)

"Eric" <er**@nospam.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl...
| I'm trying to reproduce the following table layout using CSS only and am
| having some trouble with it. I'd like them to look identical but I'm
having
| trouble sizing the labels properly as it doesnt seem to be working
| correctly:
|
| Here's the table:
|
| <table class="Table1" cellSpacing="0" cellPadding="0"
| borderColorLight="white" border="1">
| <tr class="HeaderTr">
| <td align="center">Static Reports</td>
| <td align="center">Real Time Reports</td>
| <td align="center">Daily Reports</td>
| <td align="center">Month End Reports</td>
| </tr>
| <tr>
| <td align="center"><asp:label id="lStaticUpdateTime"
RUNAT="server"
| WIDTH="173px"></asp:label></td>
| <td align="center"><asp:label id="lCurrentReportsTime"
| RUNAT="server" WIDTH="173px"></asp:label></td>
| <td align="center"><asp:dropdownlist id="dDailyDate"
RUNAT="server"
| WIDTH="173px"></asp:dropdownlist></td>
| <td align="center"><asp:dropdownlist id="dEomDate" RUNAT="server"
| WIDTH="173px"></asp:dropdownlist></td>
| </tr>
| </table>
|
| Here's the style sheet entry for the table.
| .Table1
| {
| background-color: #6699cc;
| font-family: Verdana, Arial;
| font-size: 11px;
| color: white;
| border: 0px;
| text-align: left;
| font-weight: bold;
| }
|
|
|
Nov 19 '05 #3

"Eric" <er**@nospam.com> a écrit dans le message de news:
ei**************@TK2MSFTNGP15.phx.gbl...
Ah, part of the problem is Visual Studio doesnt display it correctly in
design mode when using CSS. You have to use View in Browser to get what
it
really looks like. Although I'm not sure how to remove the spacing
between
labels, it looks closer now.


Generally speaking, Visual Studio seems to behave somewhat like IE5, even if
you are using IE6 / DOCTYPE detection for your aspx.
Nov 19 '05 #4
Actually, that is a misleading statement bruce. The CSS box model [1]
supports such constructs that can be applied to any HTML element (when using
the div) noting that IE requires the infamous 'box model hack' to support
such constructs.

--
<%= Clinton Gallagher
METROmilwaukee "Regional Information Services"
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/

[1] http://webdesign.about.com/library/weekly/aa121602a.htm

"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
there is no css equalivent value for cellpadding and cellspacing, as this is a table only attribute.

-- bruce (sqlwork.com)

"Eric" <er**@nospam.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl...
| I'm trying to reproduce the following table layout using CSS only and am
| having some trouble with it. I'd like them to look identical but I'm
having
| trouble sizing the labels properly as it doesnt seem to be working
| correctly:
|
| Here's the table:
|
| <table class="Table1" cellSpacing="0" cellPadding="0"
| borderColorLight="white" border="1">
| <tr class="HeaderTr">
| <td align="center">Static Reports</td>
| <td align="center">Real Time Reports</td>
| <td align="center">Daily Reports</td>
| <td align="center">Month End Reports</td>
| </tr>
| <tr>
| <td align="center"><asp:label id="lStaticUpdateTime"
RUNAT="server"
| WIDTH="173px"></asp:label></td>
| <td align="center"><asp:label id="lCurrentReportsTime"
| RUNAT="server" WIDTH="173px"></asp:label></td>
| <td align="center"><asp:dropdownlist id="dDailyDate"
RUNAT="server"
| WIDTH="173px"></asp:dropdownlist></td>
| <td align="center"><asp:dropdownlist id="dEomDate" RUNAT="server" | WIDTH="173px"></asp:dropdownlist></td>
| </tr>
| </table>
|
| Here's the style sheet entry for the table.
| .Table1
| {
| background-color: #6699cc;
| font-family: Verdana, Arial;
| font-size: 11px;
| color: white;
| border: 0px;
| text-align: left;
| font-weight: bold;
| }
|
|
|

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
by: Zak McGregor | last post by:
Hi all Are there any good solutions to aligning form field names and input boxes without resorting to tables? I am struggling to do this nicely at the moment. Thanks Ciao Zak
3
by: sinister | last post by:
From http://www.oreillynet.com/pub/a/javascript/synd/2002/03/01/css_layout.html "Typically CSS layout replaces tables, which are currently the most popular method of placing page elements. There...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
6
by: briand | last post by:
How do I make many pages with the same layout? I have created header, side bar, main body, and footer web controls and added them to a table. I have many pages that want to use this same layout,...
10
by: Volker Lenhardt | last post by:
For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I try to layout my data output in a QScrollView as the central widget. I'd prefer to use QGridLayout, but cannot add it to the...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
0
by: Just Jeff | last post by:
Hi, I am a newbie to CSS. My problem at this point has to do with layout. I've inherited a website that uses nested tables for the layout of the page (www.gccnh.com), which I would like to...
3
by: rajeshkrsingh | last post by:
Hi friends, Step1- create table duplicate ( intId int, varName varchar(50) ) insert into duplicate(intId,varName) values(1,'rajesh') insert into duplicate(intId,varName) values(2,'raj12')...
53
by: brave1979 | last post by:
Please check out my javascript library that allows you to create any layout for your web page, nested as deep as you like, adjusting to width and height of a browser window. You just describe it in...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.