473,770 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Indenting TABLE DIV element

2 New Member
I'm using a web application for an online survey system. The pages rendered are XHTML transitional ("<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">")... but it doesn't validate (a big problem, I know).

It looks like this initially...



...and I'm trying to indent the entire element below the header text like so...



...but the problem is that it applies the change not only the parent TABLE/DIV combo, but then the children as well (which is why the radio buttons ended up being shifted over too I believe).

I can't change any of the code of the application, but the application references an external CSS file that I can edit only (so I can't change the fact that there aren't many/any classes assigned to the elements to use directly... but I can modify this one file and have the changes applied).

What I've tried thus far is to use either of the following...
Expand|Select|Wrap|Line Numbers
  1. TABLE DIV {position: relative; left: 25px;}
  2. TABLE DIV {padding-left: 25px;}
I found the tree using Firebug for Firefox, is there a way to make the CSS code by applied to only the first/parent TABLE/DIV combo and not it's children? Maybe I could start with BODY TABLE DIV or something?

I would really appreciate any assistance possible.
Dec 3 '07 #1
3 6200
Death Slaught
1,137 Top Contributor
I don't think you can get it to work the way you want to without access to the XHTML document.

- Death
Dec 3 '07 #2
drhowarddrfine
7,435 Recognized Expert Expert
Look into CSS Selectors, particularly the table which shows the various options about half way down. Look at the pseudo classes and pseudo elements in particular.
Dec 3 '07 #3
bigteejay
2 New Member
Here is what I ended up using...

Expand|Select|Wrap|Line Numbers
  1. /* Handle indentation of Item questions */
  2. body form div div span div span div table tbody tr td div table { margin-left: 25px; } /* matrix */
  3. body form div div span div span div table tbody tr td div div table { margin-left: 25px; } /* all others */
...I copied the XPath expression produced by Firebug, and then replaced the "/" element seperators with spaces (descendents versus children, IE didn't seem to like the "children" syntax/selectors). It's specific enough for both types that I needed to deal with that it affects only those.

I considered posting the html/css produced by the app (and even started creating a version to do so), but it was so ugly as to make it not even really worthwhile.

Thanks for your response!
Dec 4 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
33471
by: Wang, Jay | last post by:
I try to group several rows in a table into a div and show/hide them by click on a button somewhere with a javascript link. When clicked, the link will toggle the style of the div section's style between BLOCK and NONE. This technique works on normal text fine, but it doesn't work on part of the table, is there a solution that I can achieve the goal of turning on/off several rows all together? Thanks.
5
3125
by: Patient Guy | last post by:
In my reading of the Strict and Transitional DTD for HTML 4.0, the table row (TR) elements are contained within table section elements: THEAD, TFOOT, and TBODY. The table section elements are the defined contents of the TABLE element. The TR element is not defined as an "immediate" or "direct" contained element of TABLE. Given that
9
1829
by: bob | last post by:
What tool do most of you people use to indent your code? Doing so by hand is a bit tedious, I think.
4
548
by: Simone Battagliero | last post by:
I wrote a program which inserts and finds elements in an hash table. Each element of the table is a dinamic list, which holds all elements having the same hash value (calculated by an int hashFunction(char *key, int elements) ), so the table is an array of dynamic lists. The version of the program I've attached to this message works fine; but it's the result of an accurate debugging. I discovered that my problems consisted in just 4 lines...
102
5716
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler can't tell where a bracket is missing.... a few weeks have past, I requested a feature for the delphi ide/editor "automatic identation of code in begin/end statements etc" and today when I woke up I suddenly released a very simple solution for this...
7
2292
by: slitvinov | last post by:
I am learning Relax NG. The problem is that I cannot figure out how to make a schema for a table. In my case I would like to make a table with any name of child elements (columns) but columns should have the same number of child elements (cell). Say this file is valid <table> <column> <cell/> <cell/> </column>
7
2263
by: Harrie | last post by:
Hi group, I want to indent existing XML files so they are more readable (at least to me). At this moment I'm looking at the XML files OpenOffice.org's Writer application produces in it's zipped "SXW" format (and they're one line, probably to save space, which I find hard to read). At first I thought I was going to do it with sed/awk or something like that, but then I remembered the xsl:output element with the indent attribute of XSL and...
0
1002
by: D. Shane Fowlkes | last post by:
The Smart Indenting "feature" is driving me absolutlely crazy in VWD. Problem: VWD in Code View insists on tabbing a lot of my code over to it's own liking and effects mainly my comments in the code. First of all, I've searched the help files and searched forums.asp.net. I can't seem to find a solution so I thought I'd try here. When I look at Tools >> Options and look under Text Editor >> All Languages >> Tabs, it has a subtle...
3
4283
by: David Veeneman | last post by:
I'm having a problem getting XML output properly formatted. specifically, line breaks and indentation are missing, even though I'm using an XmlTextWriter with Formatting = Formatting.Indented. Here is the code that's generating the problem: static void Main(string args) { // Create an XML document XmlDocument document = new XmlDocument();
0
10232
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
10008
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
9873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8891
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
6682
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
5313
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...
1
3974
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
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.