I'd like to remove the <ul> and <li> tags without hurting the inside tags for all occurrances of this kind of structure:
<ul class="listapdf">
<li>something</li>
<li>something</li>
</ul>
What command can I use in MySQL command line?
MySQL's REGEXPs can locate rows, it cannot do substitutions. Do the processing into your client code.
Related
I have an eBay shop and when I make a listing I have a pre made template and I just import information to this template.
I have a short description, features, and specifications. And I need to add automatically <li></li> to every line and a pre made HTML table with custom style, Which will know how to separate with "/" symbol like I have in my private listing tool.
Is this even possible? And if it is any idea how?
I do not believe Magento works in that manner however there is an easy efficient way to accomplish this manually.
Try putting the code in Sumblime text 3 with teh Emmet plugin.
From there you can type a command like ul>li*8 (the 8 is the # of items or <li></li> tags) and then press the tab key.
the results will be
<ul>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
</ul>
From there you can fill in the blanks between the <li></li>.
I've been watching some 'codecasts' on CSSDeck.com, and I frequently see people typing things like this: ul>li*7>a to create a large amount of HTML very quickly. That code would generate this:
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
As seen on: http://cssdeck.com/labs/creating-sweet-3d-pagination
What plugin is this?
It used to be called Zen Coding, but is now called Emmet.
There are plugins for most editors, including Sublime Text 2 (which I'd recommend if you aren't already sorted for one!)
For Sublime Text if you are using Package Control, it's a simple package install emmet away.
With ul>li*3 I achieve
<ul>
<li></li>
<li></li>
<li></li>
</ul>
but what I want is something like this:
<ul>
<li>Value</li>
<li>Value</li>
<li>Value</li>
</ul>
How can I make it using Zen Coding? And one more thing - can I list different Values so that it becomes like this:
<ul>
<li>Value</li>
<li>Another Value</li>
<li>Last Value</li>
</ul>
You can use this abbreviation for the first case: ul>li{Value}*3 — you can use the curly braces for inserting the text into elements.
However, to do the second case you could only do this: ul>li{Value}+li{Another Value}+li{Last Value}, right now there is no way to list only the values for multiple elements.
However, if the only thing that would be different is a number (like in Joonas' example), you can still achieve it easily: ul>li{Line $}*3 — you can use $ in attributes or text nodes of abbreviations when using multipliers and they would transform to the element's counter.
I'm not sure I know exactly what you mean, but you can write:
Line 1
Line 2
Line 3
...and after that, you should first select these lines and then use 'wrap with abbreviation' with this zencode: ul>li*, which will produce this:
<ul>
<li>Line 1</li>
<li>Line 2</li>
<li>Line 3</li>
</ul>
Zen coding wiki:
http://code.google.com/p/zen-coding/wiki/Actions#Wrap_with_Abbreviation
How can be printed ordered list from number 6 with html only (if its not possible how should be done)?
Example:
6.home
7.place
8.etc..
9.etc..
Thanks
Use the start attribute:
<ol start=6>
<li>home</li>
<li>place</li>
...
</ol>
Note that its use is deprecated so you shouldn't use it in new documents. The W3C recommends replacing its use by CSS Counters.
(In my humble opinion though, this is partially a mistake, since the number with which a list starts isn't always a pure style choice. Numbered lists carry semantics as well and in this case I consider a number to start with semantics, not style.)
An alternative way in HTML only is:
<ol>
<li value="6">test</li>
<li>This should be 7</li>
</ol>
This allows more flexibility since you can reset numbering mid list but it is still deprecated. As Johannes Rössel said you should use CSS methods if possible.
Are you asking for the syntax for
<ol start="6">
<li></li>
<li></li>
</ol>
However, according to w3.org the start value is deprecated on OL...
This solution may not look efficient but it works (only in IE). This way you don't have to use the deprecated start attribute.
CSS code:
.hideme { display:inline;}
HTML code:
<ol id="num">
<li class="hideme"></li>
<li class="hideme"></li>
<li class="hideme"></li>
<li class="hideme"></li>
<li class="hideme"></li>
<li>home</li>
<li>place</li>
<li>etc</li>
<li>etc</li>
<li>etc</li>
<li>..</li>
</ol>
Though it works, I feel it's ugly.
I need to divide into groups several <li> elements in a list, is it possible?
(I know I an give each element different class names/separate into different <ul>)
Have you considered nested UL's? I believe this would validate:
<UL>
<LI>
<UL>
<LI></LI>
<LI></LI>
<LI></LI>
</UL>
</LI>
<LI>
<UL>
<LI></LI>
<LI></LI>
<LI></LI>
<LI></LI>
<LI></LI>
</UL>
</LI>
</UL>
Your CSS trick was my first guess; too bad you can't use that.
According to the XHTML schema (or one the schema anyway), the only thing you put inside a <ul> is a <li>, as described at http://www.w3.org/TR/2006/WD-xhtml-modularization-20060705/abstract_modules.html#s_listmodule
You might tweak the appearance of the list items using CSS, by assigning different class values to the <li> elements.
<li class="group1"> ...
<li class="group1"> ...
<li class="group1"> ...
<li class="group2"> ...
<li class="group2"> ...
<li class="group2"> ...
Have you considered using multiple-inheritance of CSS classes? This can be a bit messy to maintain, but it will solve the case of the same entry in multiple groups. The HTML looks something like this:
<ul class="pizza-toppings">
<li class="meat">pepperoni</li>
<li class="meat">bacon</li>
<li class="vegetarian">cheese</li>
<li class="vegetarian vegan">mushrooms</li>
<li class="vegetarian vegan">onions</li>
</ul>
Here we have three groups (meat, vegetarian and vegan) and some toppings, like mushrooms and onions, are part of more that one group.
I believe your only options are the ones you've already identified, multiple lists or via classes, since for an li to be in the list defined by a ul or an ol, it must be the immediate child of that ul/ol (reference).
If you need to separate into different groups items from one unordered list than they should belong to different lists isn't it OR should be grouped in an ordered list (many ULs in one OL).
If this is for presentation needs (to display one list on many columns) and you can solve a few constraints, the second technique in https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-5810687.html or explained also here : http://www.communitymx.com/content/article.cfm?page=2&cid=27F87
Such groups exist for select (optgroup) but obviously you can't separate the option elements because you must select only one of them so they should belong to the same element.