HTML: border not visible in <td> tag in firefox - html

I have a simple table in HTML> I want each cell in the the table to have its own border. I defined a CSS property for it like:
td {
width: 350px;
height: 50px;
border:thick;
border-color: black;
border-radius: 5px;
}
Html:
< table border="0">
<tr><td>Row1</td></tr>
<tr><td>Row2</td></tr>
<tr><td>Row3</td></tr>
</table>
The border is visible in the "Dreamweaver Design Mode" but when the document runs in firefox, the border vanishes. Why is it happening?

Try this:-
Demo
See Ref
<table>
<tr><td>Row1</td></tr>
<tr><td>Row2</td></tr>
<tr><td>Row3</td></tr>
</table>
td{
width: 350px;
height: 50px;
border: thick solid black;
border-radius: 5px;
}

In situations like this, where you get deviation between browsers, I always recommend going directly to a validator!
http://validator.nu/
Gives me these errors when I put your code in (with the css in a style tag in the head):
Error: Bad character after <. Probable cause: Unescaped <. Try escaping it as <. At line 15, column 2 tyle>↩</head>↩< table border=" Error: Stray start tag tr. From line 16, column 5; to line 16, column 8
="0">↩ <tr><td>Ro Error: Stray start tag td. From line 16, column 9; to line 16, column 12
>↩ <tr><td>Row1</ Error: Stray end tag td. From line 16, column 17; to line 16, column 21 r><td>Row1</td></tr> Error: Stray end tag tr. From line 16, column 22; to line 16, column 26
>Row1</td></tr> ↩ Error: Stray start tag tr. From line 17, column 5; to line 17, column 8 /tr> ↩ <tr><td>Ro Error: Stray start tag td. From line 17, column 9; to line 17, column 12 ↩ <tr><td>Row2</ Error: Stray end tag td. From line 17, column 17; to line 17, column 21 r><td>Row2</td></tr> Error: Stray end tag tr. From line 17, column 22; to line 17, column 26
>Row2</td></tr> ↩ Error: Stray start tag tr. From line 18, column 5; to line 18, column 8 r> ↩ <tr><td>Ro Error: Stray start tag td. From line 18, column 9; to line 18, column 12 ↩ <tr><td>Row3</ Error: Stray end tag td. From line 18, column 17; to line 18, column 21 r><td>Row3</td></tr>↩ Error: Stray end tag tr. From line 18, column 22; to line 18, column 26
>Row3</td></tr>↩</tab Error: Stray end tag table. From line 19, column 1; to line 19, column 8 /td></tr>↩</table>
The most important being the firstish entry:
Error: Bad character after <. Probable cause: Unescaped <. Try escaping it as <. At line 15, column 2 tyle>↩</head>↩< table border=" Error: Stray start tag tr. From line 16, column 5; to line 16, column 8

Related

How to read fixed-width data?

data looks like
212253820000025000.00000002500.00000000375.00111120211105202117
212456960000000750.00000000075.00000000011.25111120211102202117
212387470000010000.00000001000.00000000150.00111120211105202117
need to add separator like
21225382,0000025000.00,000002500.00,000000375.00,11112021,11052021,17
21245696,0000000750.00,000000075.00,000000011.25,11112021,11022021,17
21238747,0000010000.00,000001000.00,000000150.00,11112021,11052021,17
The CSV file length is high nearly 20000 rows are there is there any possibility to do
This question is generally about reading "fixed width data".
If you're stuck with this data, you'll need to parse it line by line then column by column. I'll show you how to do this with Python.
First off, the columns you counted off in the comment do not match your sample output. You seemed to have omitted the last column with a count of 2 characters.
You'll need accurate column widths to perform the task. I took your sample data and counted the columns for you and got these numbers:
8, 13, 12, 12, 8, 8, 2
So, we'll read the input data line by line, and for every line we'll:
Read 8 chars and save it as a column, then 13 chars and save it as a column, then 12 chars, etc... till we've read all the specified column widths
As we move through the line we'll keep track of our position with the variables beg and end to denote where a column begins (inclusive) and where it ends (exclusive)
The end of the first column becomes the beginning of the next, and so on down the line
We'll store those columns in a list (array) that is the new row
At the end of the line we'll save the new row to a list of all the rows
Then, we'll repeat the process for the next line
Here's how this looks in Python:
import pprint
Col_widths = [8, 13, 12, 12, 8, 8, 2]
all_rows = []
with open("data.txt") as in_file:
for line in in_file:
row = []
beg = 0
for width in Col_widths:
end = beg + width
col = line[beg:end]
row.append(col)
beg = end
all_rows.append(row)
pprint.pprint(all_rows, width=100)
all_rows is just a list of lists of text:
[['21225382', '0000025000.00', '000002500.00', '000000375.00', '11112021', '11052021', '17'],
['21245696', '0000000750.00', '000000075.00', '000000011.25', '11112021', '11022021', '17'],
['21238747', '0000010000.00', '000001000.00', '000000150.00', '11112021', '11052021', '17']]
With this approach, if you miscounted the column width or the number of columns you can easily modify the Column_widths to match your data.
From here we'll use Python's CSV module to make sure the CSV file is written correctly:
import csv
with open("data.csv", "w", newline="") as out_file:
writer = csv.writer(out_file)
writer.writerows(all_rows)
and my data.csv file looks like:
21225382,0000025000.00,000002500.00,000000375.00,11112021,11052021,17
21245696,0000000750.00,000000075.00,000000011.25,11112021,11022021,17
21238747,0000010000.00,000001000.00,000000150.00,11112021,11052021,17
If you have access to the command-line tool awk, you can fix your data like the following:
substr() gives a portion of the string $0, which is the entire line
you start at char 1 then specify the width of your first column, 8
for the next substr(), you again use $0, you start at 9 (1+8 from the last substr), and give it the second column's width, 13
and repeat for each column, starting at "the start of the last column plus the last column's width"
#!/bin/sh
# Col_widths = [8, 13, 12, 12, 8, 8, 2]
awk '{print substr($0,1,8) "," substr($0,9,13) "," substr($0,22,12) "," substr($0,34,12) "," substr($0,46,8) "," substr($0,54,8) "," substr($0,62,2)}' data.txt > data.csv

Getting error in ActionsScript for a file that doesn't exist and that file is tempInit

So, I'm converting a flash file from 10 years ago that used actionscript 2.0. Now, I'm down to the last two errors but the top and bottom ones don't exist and the errors regarding bytes_loader are invalid.
Here are the errors:
Here are the errors listed here that are in the picture in the order of their appearance:
tempInit, Line 1, Column 15 1086: Syntax error: expecting semicolon before ECHO.
tempInit, Line 2, Column 15 1086: Syntax error: expecting semicolon before flowin.
Symbol 'bytes_loader', Layer 'Layer 2', Frame 1, Line 4, Column 22 1084: Syntax error: expecting rightbrace before leftbrace.
Symbol 'bytes_loader', Layer 'Layer 2', Frame 2, Line 8, Column 23 1084: Syntax error: expecting rightbrace before leftbrace.
tempInit, Line 1, Column 15 1086: Syntax error: expecting semicolon before implode.
tempInit, Line 1, Column 15 1086: Syntax error: expecting semicolon before lightflash.
Now the code for the two that I can get to in bytes_loader;
UPDATE:
added line numbers as it appears in the action editor
Identified that tempInit does not exist anywhere in the action editor
the first frame in the movie is "STOP" then SYMBOL DEFINITIONS then the very first element is: bytes_loader with its three frames.
That's all there is...
1) frloaded = _root.getBytesLoaded();
2) frtotal = _root.getBytesTotal();
3) if (frloaded < frtotal) {
4) tellTarget("_root") {
5) stop();
6) }
7) }
AND
1) frloaded = _root.getBytesLoaded();
2) frtotal = _root.getBytesTotal();
3) if (frloaded < frtotal) {
4) percentloaded = int((frloaded / frtotal) * 100) + "%";
5) setProperty("wbar", _xscale, (frloaded/frtotal) * 100);
6) setProperty("bbar", _xscale, (frloaded/frtotal) * 100);
7) } else {
8) tellTarget ("_root") {
9) play();
10) }
11) }
The reference to tempInit I can't find.
So, what's wrong with the code that doesn't error out...

From Action Script 2.0 to 3.0 compiling errors

From the errors above what should I change in the code? I'm new to AS3 and a point in the right direction will help a lot, thanks!
Scene 1, Layer 'Script Layer', Frame 18, Line 62, Column 19 1084: Syntax error: expecting rightparen before add.
Scene 1, Layer 'Script Layer', Frame 18, Line 62, Column 29 1084: Syntax error: expecting rightparen before eq.
Scene 1, Layer 'Script Layer', Frame 18, Line 68, Column 24 1084: Syntax error: expecting rightparen before add.
Scene 1, Layer 'Script Layer', Frame 18, Line 68, Column 48 1084: Syntax error: expecting rightbrace before rightparen.
leng = 52;
q = 0;
while(Number(q) < Number(leng))
{
rand = random(52);
if(eval("c" add rand) eq "empty")
{
q = q - 1;
}
else
{
set("shuffle" add q,eval("c" add rand));
set("c" add rand,"empty");
}
q = Number(q) + 1;
}
q = 0;
}
ShufflePloy();
I don't know much about AS2, but first I'd try changing rand = random(52); to:
rand = Math.floor(Math.random()*52);
and then if(eval("c" add rand) eq "empty")
to
if(this["c"+rand] == "empty")
and the contents of the else block to
this["shuffle"+q] = this["c"+rand];
this["c"+rand] = "empty";

Invalid JSON - Cannot see why

The following JSON string comes back as invalid in several formatter tests. I cannot figure out for the life of me what is wrong!
{
"draw": 122,
"recordsTotal": 1496,
"recordsFiltered": 1496,
"data": [["11315","1403","John Doe","Parking Pass","-","Hyundai Sonata - Grey ABC 123 ","09-01-2016 2:00 AM","09-01-2016 7:00 AM","-"]]
}
https://jsonformatter.org/ is saying:
Parse error on line 5: ...,"Parking Pass","-","Hyundai Sonata - Gr
-----------------------^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
https://jsonformatter.curiousconcept.com/ says:
Error:Invalid characters found.[Code 18, Structure 28]
and highlights the line "Hyundai Sonata - Grey ABC 123 ",
What the heck am I missing? I dont see any invalid characters anywhere. If I paste it into Notepad++ its not showing anything but "CRLF" on the line breaks.
After checking, it turns out that the value, which was being returned from a database, had a tab in it. I created a function to strip out any non ASCII chars and its working fine now

Syntax error: expecting identifier before this. expecting colon before leftparen. expecting identifier before rightbrace

Scene 1, Layer 'script', Frame 1, Line 9 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 9 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 10 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 16 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 16 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 17 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 23 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 23 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 24 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 30 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 30 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 31 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 37 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 37 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 38 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 44 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 44 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 45 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 51 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 51 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 52 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 58 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 58 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 59 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 65 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 65 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 66 1084: Syntax error: expecting identifier before rightbrace.
these errors (27 of them) show up and my stop command wont work, whats wrong with my code?? i'm new to flash action script, and i used a youtube tutorial to create the buttons (knapp) i refere to.
here's my code
stop();
//knappane til dei forskjellige planetane
//solen
solenKnappen.addEventListener(MouseEvent.CLICK, goToSolen);
function goToSolen(event: MouseEvent);void {
this.gotoAndStop("solen")
}
//merkur
merkurKnappen.addEventListener(MouseEvent.CLICK, goToMerkur);
function goToMerkur(event: MouseEvent);void {
this.gotoAndStop("merkur")
}
//venus
venusKnappen.addEventListener(MouseEvent.CLICK, goToVenus);
function goToVenus(event: MouseEvent);void {
this.gotoAndStop("venus")
}
//jorden
jordenKnappen.addEventListener(MouseEvent.CLICK, goToJorden);
function goToJorden(event: MouseEvent);void {
this.gotoAndStop("jorden")
}
//mars
marsKnappen.addEventListener(MouseEvent.CLICK, goToMars);
function goToMars(event: MouseEvent);void {
this.gotoAndStop("mars")
}
//jupiter
jupiterKnappen.addEventListener(MouseEvent.CLICK, goToJupiter);
function goToJupiter(event: MouseEvent);void {
this.gotoAndStop("jupiter")
}
//saturn
saturnKnappen.addEventListener(MouseEvent.CLICK, goToSaturn);
function goToSaturn(event: MouseEvent);void {
this.gotoAndStop("saturn")
}
//uranus
uranusKnappen.addEventListener(MouseEvent.CLICK, goToUranus);
function goToUranus(event: MouseEvent);void {
this.gotoAndStop("uranus")
}
//neptun
neptunKnappen.addEventListener(MouseEvent.CLICK, goToNeptun);
function goToNeptun(event: MouseEvent);void {
this.gotoAndStop("neptun")
Your code's error is when using a semicolon ( ; ) to indicate the types of your functions instead of using a colon ( : ), so the code for your goToSolen() function, for example, should be like this :
function goToSolen(event: MouseEvent): void
{
this.gotoAndStop("solen");
}
And of course you should do that with all your functions.
For more about functions in ActionScript 3, take a look here.
Hope that can help.