ID:173215
 
Hey all, I was wondering if there's any way of putting a who proc into a pop up window. I tried

Who()
set category = "Utilities"
for(var/mob/M in world)
usr << browse({"












Name Key Guild
[M.name]
[M.key]
[M.guild]


"},"window=Who;clear=1;size=450x300;can_resize=0")

But shortly after wasting all 8 minutes putting it together lol, I realised that It couldn't be done that easy with more then 1 person on... So is there any way to get it so it will show everyone online inside the table without getting all buggy

(I've tried searching the forums but couldn't find anything)

::EDIT::
It would be nice if there was a way to get it so each person's info got added in a new row if possible.</<>
althought im not entirely sure how, do a loop function to repeat for all amount of users. it can be done, i just dont know how.

daniel
In response to InsayneWrapper
Your code sould be something like this (note:havent tested this code, maybe wont work, but this is a way that sould work):



var/html_who = {"

<html>

<head>
<title>Who</title>
</head>

<body>
<table border="1">
"}

for(var/mob/M in world)
if(M.key)
html += {"
<tr>
<td width="33%">src.name</td>
<td>width="33%">src.key</td>
<td width="34%">whatever</td>
</tr>"}
else return 0

html += {"
</table>
</body>
</html>
"}
usr << browse("[html_who]","window=your stuff here")


In response to Fint
Thank you so much, sometimes the simplest things are the hardest for me to find out lol. The coding itself didn't work but you gave me the right idea on doing html += inbetween the stuff for it to work, and now it works perfectly (had a thing where it showed NPCs but I just put in if(M.client) and it works perfectly)
In response to RVegeta
Glad to hear it worked out now. (thx for saying thx in the first place, people sould do that more often maybe)
Have fun coding ur game, hope it will be great.

Greetz Fint
It's worth adding here that "scope" isn't an attribute of the <th> or <td> tags; in fact it's not an attribute of any table tag, or any HTML tag I'm aware of from 4.0 or earlier.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
It's worth adding here that "scope" isn't an attribute of the <th> or <td> tags; in fact it's not an attribute of any table tag, or any HTML tag I'm aware of from 4.0 or earlier.

<buzz> wrong answer! but thanks for playing!

scope is indeed an attribute of HTML, though a lesser used one.

Direct from http://www.w3.org/TR/REC-html40/struct/tables.html :
<!ELEMENT (TH|TD)  - O (%flow;)*       -- table header cell, table data cell -- >

<!-- Scope is simpler than headers attribute for common tables -->
<!ENTITY % Scope "(row|col|rowgroup|colgroup)">

<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
<!ATTLIST (TH|TD) -- header or data cell --
%attrs; -- %coreattrs, %i18n, %events --
abbr %Text; #IMPLIED -- abbreviation for header cell --
axis CDATA #IMPLIED -- comma-separated list of related headers--
headers IDREFS #IMPLIED -- list of id's for header cells --
scope %Scope; #IMPLIED -- scope covered by header cells --
rowspan NUMBER 1 -- number of rows spanned by cell --
colspan NUMBER 1 -- number of cols spanned by cell --
%cellhalign; -- horizontal alignment in cells --
%cellvalign; -- vertical alignment in cells --
>
In response to digitalmouse
(odd I could not edit my last post)

additionally:

scope = scope-name [CI]
This attribute specifies the set of data cells for which the current header cell provides header information. This attribute may be used in place of the headers attribute, particularly for simple tables. When specified, this attribute must have one of the following values:

* row: The current cell provides header information for the rest of the row that contains it (see also the section on table directionality).
* col: The current cell provides header information for the rest of the column that contains it.
* rowgroup: The header cell provides header information for the rest of the row group that contains it.
* colgroup: The header cell provides header information for the rest of the column group that contains it.

In response to digitalmouse
w00t for once lummox jr didn't know something >.> lol :P
In response to digitalmouse
I stand corrected. Scope is an attribute that's apparently redundant and seems to serve no useful purpose, which is why it's never used.

Lummox JR