473,793 Members | 2,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

best of both worlds: CSS and table layouting?

I've been running into issue after issue trying to position text with
pure CSS (ie 3-pixel bug, margin bugs, inexplainable side-effects,
etc.). I noted that I can just put an HTML table anywhere I want on
the screen, set DIVs inside there, and for the most part, I get the
structure I want quickly and can continue to use my style sheet for the
divs. And as far as I understand, even though this is not pure
separation of design and content, as long as XHTML is used, mobile
devices and other interfaces could pick out the DIV tags they wanted
and display them however they needed to, completely ignoring the table
tags that the browser needs for structure.

Is this correct thinking on this or are there other reasons not to use
TABLEs when you need to?

Thanks,

Edward Tanguay
All my projects: http://www.tanguay.info

=============== =============== =======

#structure {
position: absolute;
top: 300px;
left: 90px;
}

<table id="structure" border="01">
<tr>
<td>cell one</td>
<td>cell two</td>
</tr>
</table>

Aug 5 '06 #1
5 2059
Rik
Edward wrote:
I've been running into issue after issue trying to position text with
pure CSS (ie 3-pixel bug, margin bugs, inexplainable side-effects,
etc.). I noted that I can just put an HTML table anywhere I want on
the screen, set DIVs inside there, and for the most part, I get the
structure I want quickly and can continue to use my style sheet for
the divs. And as far as I understand, even though this is not pure
separation of design and content, as long as XHTML is used, mobile
devices and other interfaces could pick out the DIV tags they wanted
and display them however they needed to, completely ignoring the table
tags that the browser needs for structure.
Why _X_HTML?
Is this correct thinking on this or are there other reasons not to use
TABLEs when you need to?
Yes, your data isn't table-data.
Using tables with nested divs defeats the purpose of it.

If you're running into that many issues, carefully rethinking the design to
a point where this issues don't matter as a better approach, and not really
caring about pixel-differences between browsers. It really depends on what
you're trying to accomplish, but normally my CSS is completely hack-free and
the same for all browsers, and it still looks good. (Ahum, 'good', let's say
'as I intended it', 'good' is for the viewer to decide :-)

Grtz,
--
Rik Wasmus
Aug 6 '06 #2
Well, I'd say it depends on what your goals are. If you're reaching for that
sense of satisfaction of achieving something in a pure but difficult way,
like climbing Mt. Everest without oxygen, then pure CSS is the way to go.
However if you are trying to get a product delivered to a paying customer
who is expecting it to be done in a reasonable amount of time, then tables
may be the better way.

I'm finding a lot of web developers out there use CSS for text formatting,
color schemes, etc. but revert to tables for positioning.

Aug 6 '06 #3
I have to say, having listened to a lot of text readers (JAWS etc) as
part of testing my sites, I'm pretty sick of hearing it read out the
word 'table' when there's not a table of data there. Can imagine users
who hear that all the time might not be too happy either.

An advantage of keeping tables out of layout is that your page will
load probably noticably quicker (gets rid of a lot of markup).

Best reason of all though is that the <tabletag was created for
representing tables of data and nothing else, it's purely a hack that
we use it to create layouts. If you're going to use hacks that are
related to layout, I'd say keep them to the CSS rather than the
(X)HTML..

Good luck
Den
Edward wrote:
I've been running into issue after issue trying to position text with
pure CSS (ie 3-pixel bug, margin bugs, inexplainable side-effects,
etc.). I noted that I can just put an HTML table anywhere I want on
the screen, set DIVs inside there, and for the most part, I get the
structure I want quickly and can continue to use my style sheet for the
divs. And as far as I understand, even though this is not pure
separation of design and content, as long as XHTML is used, mobile
devices and other interfaces could pick out the DIV tags they wanted
and display them however they needed to, completely ignoring the table
tags that the browser needs for structure.

Is this correct thinking on this or are there other reasons not to use
TABLEs when you need to?

Thanks,

Edward Tanguay
All my projects: http://www.tanguay.info

=============== =============== =======

#structure {
position: absolute;
top: 300px;
left: 90px;
}

<table id="structure" border="01">
<tr>
<td>cell one</td>
<td>cell two</td>
</tr>
</table>
Aug 7 '06 #4
Rik wrote:
Why _X_HTML?
The way I understand it, pure separation of form and content comes only
when you format XML with XSLT so you can control absolutely, i.e. where
data is placed and IF it is displayed at all, perhaps even changing the
text (translations) etc. So if you write your pages in strict XHTML,
devices can use a more powerful restructuring language than CSS such as
XSLT or any XML parser in any scripting language which can format the
XHTML data anyway it wants.

I was surprised getting into CSS that DIVs had to be contained within
each other in order to get the relationships you want in the CSS (e.g.
if you want your "additional information" DIV to be a right-column box,
it has to be CONTAINED IN your "main" DIV but you don't have the
freedom to switch them around in CSS). I thought that I would just be
outputting a list of DIVs and let CSS format it anyway it wants, but
this isn't the case. If DIVs are not contained in each other, then CSS
is limited as to how it can format the information, so the "raw" HTML
data already has predetermined structure in it.

I was expecting in CSS something like the ANCHOR information you put in
objects in VBA so that you can anchor any DIV to any other DIV, thereby
letting CSS have free reign on the formatting.

Is this a limitation of CSS that runs against the form/content
separation philosophy?

Thanks,

Edward Tanguay
All my projects: http://www.tanguay.info

Aug 7 '06 #5
On 6 Aug 2006 20:32:37 -0700, Edward wrote:
if you want your "additional information" DIV to be a right-column box,
it has to be CONTAINED IN your "main" DIV but you don't have the
freedom to switch them around in CSS).
Do not quite understand this.

If switching between main div and right collumn div - of course it is not
possible via css since they are bounded by html. Do you find a logic in
switching <tableand <tdarround?

Switching right collummn div to left collumn div (or anything else) is
rather simple in CSS.

--
buy, bought, bye
Aug 8 '06 #6

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

Similar topics

3
1461
by: Ares Lagae | last post by:
Suppose one is writing a library behavior the classes A1, A2 and A3, which share some common behavior. Some applications will only use one of the classes, while other applications will use all of them. Because the classes share common behavior, the library designed has to choose wether to introduce an abstract base class A, or not. Introducing an ABC has the advantage of run time flexibility, but efficiency suffers (virtual functions &...
7
1503
by: polarz | last post by:
I wrote a front end to a command line mp4 music tagger that reads my playlist files and gets info such as artist, title, album, etc, etc. I use the info to catalog, tag, sort, etc, my files. I've run into a small encoding problem. I started using a fopen like so. fopen = new StreamReader(myPlaylist); Everything worked well until I ran into groups like Mötley Crüe with strange chars in the title. The default encoding above failed to...
0
2694
by: Johannes Unfried | last post by:
Problem Best practice needed to marshal STL data from managed code to unmanaged code & vice vers Details managed code is written in managed C++ & accesses the unmanaged code (i.e. lives in a mixed mode DLL unmanaged code is written in unmanaged C++ & resides in an unmanaged DL Product used is VS.NET 200 Please tell me what is the best practice for getting and setting data fro unmanaged to managed part when I have a class with...
11
4148
by: kiln | last post by:
I am starting a project that may be suitable for vb.net, using windows forms. I want a rich client, thus win forms vs web forms. Most users will access the app data over a LAN, but some will be remote users, accessing via vpn. I could use terminal services for this but am thinking that an alternate technology like remoting or web servies could be viable. - Rich client - N-Tier - LAN & Internet clients (via VPN)
14
4862
by: Mac via DotNetMonster.com | last post by:
Hi all, As some of you would know from my previous posts that I am rewriting our Unix based system into .Net with a MDI interface. Recently I have added a tab control to the top of the MDI parent form that will contain a tab page for each open MDI child form. It is only 24 pixels high so all you see is the tabstrip. Then I only have to add a bit of code to the "changed index" event of the tab control as well as the "on activate" event...
2
3145
by: MLH | last post by:
With a table of holidays and A97's date fn's - how best to count weekends and holidays between two dates? My holiday table has 4 fields. I will be adding records to it each year as info becomes known. What approach would you advise to tally up the number of holidays, saturdays and sundays between any 2 dates in the range of my records in this table?
16
3070
by: listerofsmeg01 | last post by:
Hi all, New to Javascript, and want to learn to do things the RIGHT way. I have a dynamic table which is populated using Javascript. Currently I am looking at adding nodes using the W3C DOM, but these seems pretty long winded, especially adding all the attributes etc. Is there a way to just blat in a lump of HTML text, or is this frowned upon now?
13
2508
by: BK | last post by:
Our .Net team has just inherited a junior programmer that we need to get up to speed as quickly as possible. Unfortunately, his skill set is largely Access with some VB6 and ASP classic experience. We employ some parts of XP such as pair programming, and this should help. Other than books, does anyone have any suggestions? His skill set is pretty antiquated and we need to get him up to speed as quickly as possible so any suggestions...
20
10052
by: Joe | last post by:
Is any one charting packing considered to be the "best"? We've used ChartFX but wasn't too happy about the way data had to be populated along with some other issues which slip my mind right now and Dundas has bugs and doesn't do a good enough job displaying axis labels and is very slow to paint large numbers of series and data points. We're currently evaluating ProEssentials which we are happy with but it's not a native .NET package. ...
0
9671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10161
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9035
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6777
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.